<template>
	<view class="container">
		<!-- 我的页面 -->
		<u-navbar title="应急救援" bg-color="#00000000" leftIcon=" " titleStyle="color:#fff" leftIconColor="#fff"
			placeholder></u-navbar>

		<view class="content">
			<!-- 背景 -->
			<view class="top"></view>

			<view class="main">
				<!-- 地图 -->
				<view class="map">
					<web-view src="../../static/html/map.html" style="width: 97.5%;height: 450rpx;"></web-view>
				</view>
				<!-- 功能 -->
				<view class="rescue">
					<!-- <view class="tab"> -->
					<!-- <text @click="changetabOne" class="tabLine">搭电</text>
						<text @click="changetabOne">换胎</text>
						<text @click="changetabTwo">拖车</text> -->
					<!-- </view> -->

					<!-- tab头部 -->
					<u-tabs :list="list1" @click="click" :scrollable="false"
						activeStyle="font-weight: bold;font-size: 30rpx;"
						inactiveStyle="font-weight: bold;font-size: 30rpx;">
					</u-tabs>

					<!-- tab内容 -->
					<view class="tab_content">
						<view class="tab_text" v-if="tabOne">
							<text class="prop">位置</text>
							<input type="text" placeholder="河南省焦作市山阳区32号" name="" id="" />
							<text class="prop">求助人</text>
							<input type="text" placeholder="张先生" />
							<text class="prop">联系方式</text>
							<input type="text" placeholder="15523632541" name="" id="" />
							<text class="prop">车牌</text>
							<input type="text" placeholder="豫CJ4321" name="" id="" />
							<text class="prop">描述</text>
							<textarea placeholder="请准确描述当前的状况及所需的帮助" name="" id="" cols="30" rows="10"></textarea>
						</view>


						<view class="tab_text" v-if="!tabOne">
							<text class="prop">起点</text>
							<input type="text" placeholder="河南省焦作市山阳区32号" name="" id="" />
							<text class="prop">终点</text>
							<input type="text" placeholder="山阳区解放路66号" name="" id="" />
							<text class="prop">求助人</text>
							<input type="text" placeholder="张先生" />
							<text class="prop">联系方式</text>
							<input type="text" placeholder="15523632541" name="" id="" />
							<text class="prop">车牌</text>
							<input type="text" placeholder="豫CJ4321" name="" id="" />
							<text class="prop">描述</text>
							<textarea placeholder="请准确描述当前的状况及所需的帮助" name="" id="" cols="30" rows="10"></textarea>
						</view>
					</view>

					<!-- tab底部 -->
					<view class="btn">
						<u-button text="呼叫救援" shape="circle"
							color="linear-gradient(to right, #FF7438, #FF4000)"></u-button>
						<view class="text" @click="record">救援记录 ></u-icon></view>
					</view>
				</view>

				<view class="call">
					<view class="title">警务救助</view>
					<view class="call_content">
						<view class="list">
							<image src="../../static/images/rescue-icon1.png" mode=""></image>
							<view class="name">交通事故</view>
							<view class="num">122</view>
						</view>
						<view class="list">
							<image src="../../static/images/rescue-icon2.png" mode=""></image>
							<view class="name">火警</view>
							<view class="num">119</view>
						</view>
						<view class="list">
							<image src="../../static/images/rescue-icon3.png" mode=""></image>
							<view class="name">急救中心</view>
							<view class="num">120</view>
						</view>
						<view class="list">
							<image src="../../static/images/rescue-icon4.png" mode=""></image>
							<view class="name">公安报警</view>
							<view class="num">110</view>
						</view>
					</view>
				</view>

				<!-- <view class="placeholder"></view> -->

			</view>
		</view>
		<TabBar></TabBar>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				show: false,
				tabOne: true,
				list1: [{
					name: '搭电',
				}, {
					name: '换胎',
				}, {
					name: '拖车'
				}, ],
			};
		},
		methods: {
			// tab切换
			click(item) {
				// console.log('item', item);
				if (item.index < 2) {
					this.tabOne = true;
				} else {
					this.tabOne = false;
				}
			},
			// 跳转救援记录
			record() {
				uni.navigateTo({
					url: './RescueRecord',
				});
			}
		}
	}
</script>

<style lang="scss" scoped>
	.content {
		position: absolute;
		top: 0;

		.top {
			width: 750rpx;
			height: 400rpx;
			// background-image: url('http://www.img.ttblog.cn/car/header-bg.png');
			background-color: #3384FC;
			background-size: cover;
			// display: flex;
			// flex-direction: column;
			// align-items: center;
		}

		.main {
			transform: translateY(-170rpx);
			margin-top: -90rpx;
			padding: 0 20rpx;

			// 地图
			.map {
				width: 100%;
				height: 450rpx;
				background-color: #fff;
				border-radius: 20rpx;
				padding: 30rpx;
				box-sizing: border-box;
			}

			// 中间部分
			.rescue {
				margin-top: 20rpx;
				background-color: #fff;
				padding: 20rpx 30rpx;
				border-radius: 20rpx;

				// tab
				// 表单部分
				.tab_content {
					margin-top: 40rpx;

					.tab_text {
						display: flex;
						flex-direction: row;
						flex-wrap: wrap;
						justify-content: space-between;

						.prop {
							display: inline-block;
							width: 20%;
							height: 60rpx;
							text-align: center;
							line-height: 60rpx;
							border-radius: 40rpx;
							background-color: #4FA2FF;
							font-size: 24rpx;
							color: #fff;
							margin-right: 20rpx;
						}

						input,
						textarea {
							font-size: 25rpx;
							width: 76%;
							height: 60rpx;
							border: 1rpx solid #ccc;
							border-radius: 30rpx;
							padding: 10rpx 20rpx;
							box-sizing: border-box;
							margin-bottom: 20rpx;
						}

						textarea {
							height: 170rpx;
						}
					}
				}

				// 呼叫救援
				.btn {
					margin-top: 10rpx;
					text-align: center;

					.text {
						margin: 20rpx 0;
						font-size: 25rpx;
						color: #a09e9e;
					}
				}
			}

			// 警务救助
			.call {
				margin-top: 20rpx;
				background-color: #fff;
				padding: 20rpx 30rpx;
				border-radius: 20rpx;

				.title {
					font-size: 32rpx;
					font-weight: bold;
				}

				.call_content {
					margin-top: 40rpx;
					display: flex;
					flex-direction: row;
					justify-content: space-between;

					.list {
						display: flex;
						flex-direction: column;
						justify-content: space-between;
						align-items: center;
						height: 150rpx;

						image {
							height: 70rpx;
							width: 50rpx;
							margin-bottom: 20rpx;
						}

						.name,
						.num {
							font-size: 30rpx;
						}
					}
				}
			}

			.placeholder {
				height: 15.33vw;
			}

			/deep/ .u-button {
				width: 80%;
				background-color: #D9D9D9;
				color: #fff;
			}
		}
	}
</style>